//
//  UILabel+Extension.swift
//  Practice
//
//  Created by miaozhihui on 2016/12/9.
//  Copyright © 2016年 DeKuTree. All rights reserved.
//

import UIKit

extension UILabel {
    
    /// 便利构造函数
    ///
    /// - Parameters:
    ///   - title: title
    ///   - fontSize: fontSize,默认14号字
    ///   - color: color,默认深灰色
    convenience init(title:String,fontSize:CGFloat = 14,color:UIColor = UIColor.darkGray,isCenter:Bool = true) {
        self.init()
        text = title
        textColor = color
        font = UIFont.systemFont(ofSize: fontSize)
        numberOfLines = 0
        textAlignment = isCenter ? .center : .natural
    }
}
